-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gpgpuimgui #707
base: master
Are you sure you want to change the base?
Gpgpuimgui #707
Conversation
…appers, update examples_tests submodule
…pping into vertex shader - TODO: fill clipping plane distances
…sl and spirv_intrinsics/core.hlsl because of microsoft/DirectXShaderCompiler#6751
…ipeline barier to change the font image's layout after the buffer update from TRANSFER_DST_OPTIMAL to READ_ONLY_OPTIMAL
…ngine for this purpose with full test suite. Enter runtime issues, I think it's because of how I currently share resources across modules and the fact ImGUI context is static
include/nbl/ext/ImGui/ImGui.h
Outdated
core::smart_refctd_ptr<video::IDescriptorPool> m_descriptorPool; | ||
core::smart_refctd_ptr<video::IGPUDescriptorSet> m_gpuDescriptorSet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are super weird to belong to ImGUI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/nbl/ext/ImGui/ImGui.cpp
Outdated
smart_refctd_ptr<IGPUDescriptorSetLayout> UI::CreateDescriptorSetLayout() | ||
smart_refctd_ptr<IGPUDescriptorSetLayout> UI::createDescriptorSetLayout() | ||
{ | ||
nbl::video::IGPUDescriptorSetLayout::SBinding bindings[] = { | ||
nbl::video::IGPUDescriptorSetLayout::SBinding bindings[] = | ||
{ | ||
{ | ||
.binding = 0, | ||
.binding = 0u, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as the user to provide a descriptor set layout, also as what binding Ix holds the textures we'll index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
…ate memory corruption issues. Make NITE work, now we just need to take care of imguizmo which doesn't like the configuration
src/nbl/ext/ImGui/ImGui.cpp
Outdated
void UI::createDescriptorPool() | ||
{ | ||
static constexpr int TotalSetCount = 1; | ||
IDescriptorPool::SCreateInfo createInfo = {}; | ||
createInfo.maxDescriptorCount[static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER)] = TotalSetCount; | ||
createInfo.maxDescriptorCount[static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER)] = 1u; | ||
createInfo.maxDescriptorCount[static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_STORAGE_BUFFER)] = 1u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user shall be in charge of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/nbl/ext/ImGui/ImGui.cpp
Outdated
} | ||
tQueue->endCapture(); | ||
|
||
auto & io = ImGui::GetIO(); | ||
io.DisplaySize = ImVec2(m_window->getWidth(), m_window->getHeight()); | ||
io.DisplayFramebufferScale = ImVec2(1.0f, 1.0f); | ||
|
||
m_vertexBuffers.resize(maxFramesInFlight); | ||
m_indexBuffers.resize(maxFramesInFlight); | ||
m_mdiBuffers.resize(maxFramesInFlight); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you'll use StreamingTransientDataBufferST
for the mdiBuffer, you can forget about maxFramesInFlight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/nbl/ext/ImGui/ImGui.cpp
Outdated
bool UI::render(IGPUCommandBuffer* commandBuffer, const uint32_t frameIndex) | ||
{ | ||
const bool validFramesRange = frameIndex >= 0 && frameIndex < maxFramesInFlight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using StreamingTransientDataBufferST
for the mdi buffers will free you from having to ask for the frameIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw also take SIntededSubmit
instead of just commandBuffer
then you'll be able to handle overflows nicely and also steal the signalSemaphores
to latch the free of the mdiBuffer allocation upon a frame completion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we agreed we remove SIntededSubmit
from the render method due to overflow & non-dynamic renderpass issues
core::vector2df_SIMD scale; | ||
core::vector2df_SIMD translate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use nbl::hlsl::float32_t2
types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another PR
src/nbl/ext/ImGui/ImGui.cpp
Outdated
VkRect2D scissor[] = { {.offset = {(int32_t)viewport.x, (int32_t)viewport.y}, .extent = {(uint32_t)viewport.width, (uint32_t)viewport.height}} }; | ||
commandBuffer->setScissor(scissor); // cover whole viewport (only to not throw validation errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just create a pipeline without any scissors (its in the pipeline creation parameters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot because currently we hardcode dynamic state - VK_DYNAMIC_STATE_SCISSOR as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ask user for the number of dynamic scissors that will be used for the Graphics Pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
for (auto i = 0u; i < m_maxFramesInFlight; i++) | ||
{ | ||
if (!m_cmdPool) | ||
return logFail("Couldn't create Command Pool!"); | ||
if (!m_cmdPool->createCommandBuffers(IGPUCommandPool::BUFFER_LEVEL::PRIMARY, { m_cmdBufs.data() + i, 1 })) | ||
return logFail("Couldn't create Command Buffer!"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably create all commandbuffers at once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we agreed to fix/update/adjust the nite in the next PR
const auto resourceIx = m_realFrameIx % m_maxFramesInFlight; | ||
|
||
if (m_realFrameIx >= m_maxFramesInFlight) | ||
{ | ||
const ISemaphore::SWaitInfo cbDonePending[] = | ||
{ | ||
{ | ||
.semaphore = m_semaphore.get(), | ||
.value = m_realFrameIx + 1 - m_maxFramesInFlight | ||
} | ||
}; | ||
if (m_device->blockForSemaphores(cbDonePending) != ISemaphore::WAIT_RESULT::SUCCESS) | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some surgery between two examples went wrong.
The new examples use m_submitIx
to advance the semaphore each time the main render submission is done.
and here you're doing some sync based on m_realFrameIx
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we agreed to fix/update/adjust the nite in the next PR
…fig header on fly with CMake and share across imgui projects. TODO: add NBL_IMGUI_WITH_TEST_ENGINE enabled by default which makes all imgui projects use our configuration with embedding the test engine and enables the nite tool, otherwise disables stuff and limits the imgui build to minimum
…e and use running modes
…buffer themselves & validate its creation params, memory, allocate + mapping flags, update examples_tests submodule
… minimum (remove optional delta in secs, 1/60 by default), get rid of our IWindow & ICursor dependency from the UI, move ImGui::Render() from .update to .render, update examples_tests submodule
…ter multi_allocate, don't try to map MDI memory range in case its unmapped at .render
src/nbl/ext/ImGui/ImGui.cpp
Outdated
@@ -816,7 +816,7 @@ namespace nbl::ext::imgui | |||
|
|||
auto mdiBuffer = smart_refctd_ptr<IGPUBuffer>(m_mdi.streamingTDBufferST->getBuffer()); | |||
{ | |||
std::chrono::steady_clock::time_point timeout(std::chrono::seconds(0x45)); | |||
auto timeout(std::chrono::steady_clock::now() + std::chrono::seconds(1u)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still should be MILISECONDS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
… required usage buffer flags, increase minStreamingBufferAllocationSize to 32u
…akes, also the design for the subscriber could be better however lets leave it currently
…the constructor, do also another clean-up, put stuff into nice creation parameters struct, remove unnecessary font adjusting static method + a few IO variables we were setting to their default values anyway, add more comments for users, update examples_tests submodule
include/nbl/ext/ImGui/ImGui.h
Outdated
|
||
struct S_CREATION_PARAMETERS | ||
{ | ||
video::IUtilities* const utilities; //! required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for image upload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes+ I like the fact I already have device + logger there
…s deflate dependency, it should never look system wide but download
…ve NSC from the ImGUI extension build system & embed shader sources instead (leave some comments), codegen & compile shaders on fly with respect to new optional S_RESOURCE_PARAMETERS (leave user freedom to specify set & resource bindings with certain required constraints), add more validation to the UI creation, update examples_tests submodule
…XTURES_BINDING, NBL_SAMPLER_STATES_BINDING, NBL_RESOURCES_COUNT & NBL_RESOURCES_SET. Validate external descriptor set layout if given (redirects, validate required textures & samplers binding), support generating default one if nullptr passed. Add more comments for API usage, update examples_tests submodule
…recording non-dynamic renderpass - bring back command buffer + add semaphore wait info for deferred memory deallocation, clean more code, add comments regarding linear allocator TODO, update examples_tests submodule
…tin/hlsl/glsl_compat/core.hlsl
…yout with pipeline layout in the creation parameters, update examples_tests submodule
…cator host allocator + LinearAddressAllocatorST sub-allocator combo & use allocator type traits to handle them, update examples_tests submodule, leave some TODO comments
Description
Testing
TODO list: